<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
	<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
	<%@ taglib uri="/timefunction" prefix="tmf"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    
    <title>My JSP 'player_list_editor.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <a href="${pageContext.request.contextPath}/admin">返回管理</a><br/>
  <h1>播放管理</h1>
  <hr>
  <h2>新增歌曲</h2>
  <form method="post" action="${pageContext.request.contextPath}/blog/music.do?method=add">
  <table width="642" height="133" border="1">
  	<tbody>
     <tr>
       <td width="137" rowspan="3"><img width="100" height="100" src=""/></td>
       <td> <p><label for="">Song Title:</label><input type="text" name="annotation" class="regular-text songtitle" value="" /><label for="">Link to:</label><input type="text" name="info" class="regular-text songlink" value="" /></p></td>
     </tr>
     <tr>
       <td> <p><label for="">Song's URL:</label><input type="text" name="location" class="songurl" value="" size="80" /></p></td>
     </tr>
     <tr>
       <td height="17"><p><label for="">Image URL:</label><input type="text" name="image" class="songimage" value="" size="80" /></p></td>
     </tr>
	 <tr>
	 	<td colspan="3"><input type="submit" value="增加"/></td>
	 </tr>
	 </tbody>
   </table>
  </form>
  <hr>
  <h2>播放列表</h2>
    <table width="642" height="133" border="1">
    <c:forEach items="${playList.trackList}" var="trackList">
    <c:forEach items="${trackList.track}" var="track">
    <form id='uptrk-${track.id}' method="POST" action="${pageContext.request.contextPath}/blog/music.do?method=update&id=${track.id}" >
	<tbody>
     <tr>
       <td width="137" rowspan="3"><img width="100" height="100" src="${track.image }" /></td>
       <td> <p><label for="">Song Title:</label><input type="text" name="annotation" class="regular-text songtitle" value="${track.annotation }" /><label for="">Link to:</label><input type="text" name="info" class="regular-text songlink" value="${track.info }" /></p></td>
     </tr>
     <tr>
       <td> <p><label for="">Song's URL:</label><input type="text" name="location" class="songurl" value="${track.location }" size="80" /></p></td>
     </tr>
     <tr>
       <td height="17"><p><label for="">Image URL:</label><input type="text" name="image" class="songimage" value="${track.image }" size="80" /></p></td>
     </tr>
	 <tr>
	 	<td ><input type="button" value="更新"
	 	 onclick="if (confirm('你确定要更新这首歌？')) { var f = document.getElementById('uptrk-${track.id}'); f.style.display = 'none';f.submit(); };return false;" title="更新" />
	 	</td>
	 	<td colspan="2" align="right">
	 	<input type="button" value="删除"
	 	 onclick="if (confirm('你确定要删除这这首歌？')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = '${pageContext.request.contextPath}/blog/music.do?method=delete&id=${track.id}';f.submit(); };return false;" title="删除" />
	 	 </td>
	 </tr>
	 </tbody>
	 </form>
	 </c:forEach>
	</c:forEach>
   </table>
</body>
</html>
